﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTO;
using System.Data;

namespace DAL
{
    public class CategoryDAL:Base<Category>
    {
        public CategoryDAL()
            : base("Category", "ID")
        {
        }
        /// <summary>
        /// 返回用户分类
        /// </summary>
        /// <param name="aid"></param>
        /// <returns></returns>
        public DataTable GetCategoryTable(string aid)
        {
            string sql = "select * from `category` where (OwnerID = 0 or OwnerID=@aid) and `ID` not in(select `RemoveID` from `category_remove` r where r.`OwnerID`=@aid)";
            return MySQLHelper.Query(sql, GetParams("aid", aid));
        }

        public override bool Insert(Category entity)
        {
            throw new NotImplementedException();
        }

        public override bool Update(Category entity)
        {
            throw new NotImplementedException();
        }

        public override Category GetEntityById(int id)
        {
            throw new NotImplementedException();
        }

        public override Category GetEntityById(string id)
        {
            throw new NotImplementedException();
        }
    }
}
